home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / Libraries / DCLAP 4j / Drtf / DHTMLprocess.h < prev    next >
Encoding:
Text File  |  1995-12-17  |  2.8 KB  |  109 lines  |  [TEXT/R*ch]

  1. // DHTMLprocess.h
  2. // d.g.gilbert
  3.  
  4. #ifndef _DHTMLPROCESS_
  5. #define _DHTMLPROCESS_
  6.  
  7. #include "DRichProcess.h"
  8.  
  9.  
  10. struct HTMLKey
  11. {
  12.     short    htmlKMajor;    /* major number */
  13.     short    htmlKMinor;    /* minor number */
  14.     char    *htmlKStr;    /* symbol name */
  15.     short    htmlKStop;    /* type of key termination */
  16.     short    htmlKHash;    /* symbol name hash value */
  17. };
  18.  
  19.  
  20.      
  21. class DHTMLprocess : public DRichprocess
  22. {
  23. public:
  24.     static void InitKeys();
  25.  
  26.     DHTMLprocess( DFile* itsFile, DRichView* itsDoc, Nlm_MonitorPtr progress);
  27.                                 //DGopherList* itsLinks
  28.     virtual ~DHTMLprocess();
  29.  
  30.     virtual void    handleTextClass();
  31.     virtual void    handleControlClass(); 
  32.  
  33. protected:
  34.     
  35.     enum majorKeys {
  36.         htmlDocAttr,
  37.         htmlLinkAttr,
  38.         htmlCharAttr,
  39.         htmlParAttr,
  40.         htmlListAttr,
  41.         htmlPictAttr,
  42.         htmlSpecialChar,
  43.         htmlEndControl
  44.         };
  45.     
  46.     enum minorKeys {
  47.         htmlHTML, htmlTitle, htmlHead, htmlBody, htmlIsIndex, htmlLink, htmlNextID, htmlBase,
  48.         htmlAnchor, htmlHref, htmlName, htmlRel, htmlRev, htmlUrn, htmlMethods,
  49.         htmlBold,htmlEmphasis,htmlMoreEmphasis,htmlItalic,htmlFixedwidth,
  50.         htmlPlain, htmlSampleFont,htmlUserFont,htmlVarFont,htmlDefineFont,htmlCiteFont,
  51.         htmlH1,htmlH2,htmlH3,htmlH4,htmlH5,htmlH6,htmlAddress,htmlBlockquote,
  52.         htmlPreformat,htmlLinewidth, 
  53.         htmlDL,htmlCompact,htmlDT,htmlDD,
  54.         htmlBullList,htmlNumList,htmlMenu,htmlDir,htmlListItem,
  55.         htmlImage,htmlImageSrc,htmlImageAlt,htmlAlign, htmlIsMap,
  56.         htmlForm, htmlInput, htmlSelect, htmlTextarea, htmlValue, 
  57.         htmlType, htmlOption, htmlAction, htmlMethod,
  58.         htmlInvisible, htmlComment,
  59.         htmlNoKey = -1
  60.         };
  61.     
  62.     enum specialChars {
  63.         htmlPar= 300, htmlHBar, htmlNewline, htmlPage, htmlTab, 
  64.         htmlNoChar = -1
  65.         };
  66.         
  67.     enum    stopKeys {
  68.         kNoStop,
  69.         kSlashStop,
  70.         kAmperChar // special characters of &char; style
  71.         };
  72.     
  73.     static HTMLKey htmlKeys[];
  74.     static HTMLKey htmlAmperChars[];
  75.     static short Hash( char    *s);
  76.  
  77.     Boolean fInControl, fTurnOn, fPreformat, fIsIndex, fInForm, 
  78.                     fInHead, fInParam, fIsMap;
  79.     char      fQuote, fTokenBuf[kMaxTokenBuf];
  80.     long        fTokenLen;
  81.     short        fListType, fListNum, fDLStyle, // these need to be stacks ??
  82.                     fStop, fCurControl, fCurField, fPicLink, fAnchorLink;
  83.      char    * fURLstore, * fNamestore, * fFormURL, * fGoplusStore,
  84.                * fMethodstore, * fValstore, * fTypestore, *fOptionstore;
  85.   char  * fPushBuf, * fPushBufstore;
  86.   long    fPushSize;
  87.   
  88.     //DGopherList * fGolist;
  89.  
  90.     virtual void    handleDocAttr( short attr);  
  91.     virtual void    handleLinkAttr( short attr); 
  92.     virtual void    handleCharAttr( short attr); 
  93.     virtual void    handleParAttr( short attr);  
  94.     virtual void    handleListAttr( short attr);  
  95.     virtual void    handlePictAttr( short attr); 
  96.     virtual void    handleSpecialChar( short code); 
  97.     virtual void    handleEndControl( short attr);  
  98.  
  99.     virtual void  GetToken1(); // private
  100.     virtual short GotTokenOrParam(); // private
  101.     virtual short GetOneChar();
  102.     virtual void  Pushback(char c);
  103.     virtual void  Lookup( char *s, HTMLKey* keyset);
  104. };
  105.  
  106.  
  107.  
  108. #endif
  109.